/**
 * Created by weid on 2016/9/21.
 */
import './css/main.less';
import 'angular';
import 'angular-route';
import 'jquery';
import './sidebar';
import './authorization/ctrl';
import './organization/ctrl';
import '@yunke/core/angular_public_interceptor'

const app = angular.module('app', ['ngRoute', 'angularPublicInterceptor', 'authorization', 'organization']);

app.config(['$routeProvider', ($routeProvider) => {

    $routeProvider
        .when('/authorization', {
            template: require('./authorization/index.html'),
            controller: 'ctrlAuthorization'
        })
        .when('/organization', {
            template: require('./organization/index.html'),
            controller: 'ctrlOrganization'
        });

}]);

app.controller('ctrlUserManage', ['$scope', '$http', ($scope, $http) => {
    $http.get(G_CONFIG['api_prefix'] + 'user-auth/get-user-all-auth')
        .then(res => {
            $scope.userAuthList = res.data.userAuth;
        });
}]);

//angular.element( document ).ready(function () {
//    angular.bootstrap( document, [ 'app' ] );
//});

